<?php if(Yii::app()->user->isGuest): ?>

    <?php Yii::import('application.models.account.Customer');
        $model=new Customer(); ?>

    <?php $this->renderPartial('application.views.account.__registerForm'); ?>

    <div class="loginblock">

        <?php $form=$this->beginWidget('CActiveForm', array(
            'id'=>'login-form',
            'action'=>Yii::app()->createUrl('account/index/login'),
            'method'=>'post',
            'enableAjaxValidation'=>true,
            'clientOptions'=>array(
                'validateOnSubmit'=>true,
                'validateOnChange'=>false,
            ),
        )); ?>

        <?php echo CHtml::errorSummary(array($model)); ?>

        <?php echo $form->textField($model,'email',array(
            'placeholder'=>$model->getAttributeLabel('email'),
            'class'=>'loginput',
        )) ?>
        <?php echo $form->error($model,'email'); ?>

        <?php echo $form->passwordField($model,'password',array(
            'placeholder'=>$model->getAttributeLabel('password'),
            'class'=>'loginput',
        )) ?>
        <?php echo $form->error($model,'password'); ?>

        <div class="passrem"></div>

        <?php echo CHtml::link(Yii::t('base','login'),'#',array(
            'class'=>'btnenter',
            'onclick'=>'Main.formSubmit($("#login-form")); return false;',
        )); ?>

        <?php echo CHtml::link(Yii::t('account/customer','register'),'#',array(
            'class'=>'reglink',
            'data-id'=>Yii::app()->createUrl('account/index/register'),
            'onclick'=>'Main.openPopup($("#reg")); return false;',
        )); ?>
        <?php echo CHtml::link(Yii::t('account/customer','forgot'),Yii::app()->createUrl('account/index/forgot'),array(
            'class'=>'passlink',
        )); ?>

        <?php $this->endWidget(); ?>

    </div>
<?php endif; ?>